package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbAdminMapper;
import com.dongdongshop.pojo.TbAdmin;
import com.dongdongshop.pojo.TbAdminExample;
import com.dongdongshop.service.TbAdminService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@DubboService
public class TbAdminServiceImpl implements TbAdminService {

    @Resource
    private TbAdminMapper tbAdminMapper;

    @Override
    public TbAdmin selectByName(String adminName) {
        TbAdminExample example = new TbAdminExample();
        TbAdminExample.Criteria criteria = example.createCriteria();
        criteria.andAdminNameEqualTo(adminName);
        TbAdmin tbAdmin1 = tbAdminMapper.selectByExample(example).get(0);
        return tbAdmin1;
    }
}
